package com.xqt.controller;

import com.xqt.entity.sys.SysMember;
import com.xqt.entity.sys.SysMenu;
import com.xqt.entity.sys.SysRole;
import com.xqt.inters.service.sys.ISysMemberService;
import com.xqt.inters.service.sys.ISysMenuBtnService;
import com.xqt.inters.service.sys.ISysMenuService;
import com.xqt.inters.service.sys.ISysRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/3/20.
 */
@RestController
@RequestMapping(value = "/sys")
public class SysController {

    @Autowired
    private ISysMenuService sysMenuService;

    @Autowired
    private ISysMemberService sysMemberService;

    @Autowired
    private ISysRoleService sysRoleService;

    @Autowired
    private ISysMenuBtnService sysMenuBtnService;

    @RequestMapping(value = "/querymenu")
    public SysMenu queryById(@RequestParam String id){
        return sysMenuService.queryById(id);
    }

    @RequestMapping(value = "/memberquery")
    public SysMember memberQueryByName(@RequestParam Object name){
        return sysMemberService.queryByName(name);
    }

   @RequestMapping(value = "/rolelist")
    public List<SysRole> roleList(){
       SysRole sysRole = new SysRole();
       sysRole.setLimitDirection(false);
       List<SysRole> dataList = sysRoleService.queryByList(sysRole);
       return dataList;
   }

}
